package com.oceansoft.mobile.econsole.survey.persistence;

import com.oceansoft.mobile.econsole.modules.base.entity.Query;
import com.oceansoft.mobile.econsole.survey.entity.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by liujie on 2016/9/1.
 */
@Repository
public interface ISurveyMapper {
    List<Survey> findSurveyByCondition(Query query);

    Survey getSurveyById(int id);

    void newSurvey(Survey survey) throws Exception;

    void updateSurvey(Survey survey) throws Exception;

    void deleteSurvey(int id) throws Exception;

    List<Question> findQuestionByCondition(Query query);

    Question getQuestionById(int id);

    void newQuestion(Question question) throws Exception;

    void updateQuestion(Question question) throws Exception;

    void deleteQuestion(int id) throws Exception;

    void newOption(Option option) throws Exception;

    void deleteOptions(int questionid) throws Exception;

    List<Option> getOptionsByQuestion(Question question);

    List<QuestionExt> getQuestionsBySurvey(Survey survey);

    void saveAnswer(Answer answer);
}
